<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>3. Language Extensions</title>
      <meta charset="utf-8" />
      <meta name="generator" content="DocBook XSL 2.0 Stylesheets V2.5.0" />
      <link href="css/default.css" rel="stylesheet" type="text/css" />
      <link href="css/db-prism.css" rel="stylesheet" type="text/css" />
      <link rel="stylesheet" href="css/xproc.css" type="text/css" /><script type="text/javascript" src="js/dbmodnizr.js"></script></head>
   <body>
      <div class="page">
         <div class="content">
            <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="navheader">
               <table border="0" cellpadding="0" cellspacing="0" width="100%" summary="Navigation table">
                  <tr>
                     <td align="left"> <a title="XML Calabash Reference" href="index.html"><img src="img/home.png" alt="Home" border="0" /></a> <a href="extattr.html" title="2 .  Extension Attributes"><img src="img/prev.png" alt="Prev" border="0" /></a> <a title="Chapter  5 .  Extensions" href="extensions.html"><img src="img/up.png" alt="Up" border="0" /></a> <a title="4 .  Extension functions" href="extfunc.html"><img src="img/next.png" alt="Next" border="0" /></a></td>
                     <td align="right"><i>XML Calabash Reference</i> (Version 0.28)</td>
                  </tr>
               </table>
            </div>
            <div class="body">
               <section id="langext" class="section">
                  <div class="section-titlepage">
                     <h2>3. Language Extensions</h2>
                  </div>
                  <div class="content">
                     <p><em class="citetitle">XML Calabash</em> has three language extensions:
                        “general values”, “XPointer on text”, and “transparent JSON”. Enabling
                        any of these extensions makes the processor <em>non-conformant</em>.
                        Pipelines that rely on these extensions are not likely to be
                        interoperable with other implementations. You're encouraged to avoid
                        them if possible. That said, they can be very useful.</p>
                     <section id="ext.general-values" class="section">
                        <div class="section-titlepage">
                           <h3>3.1. General values extension</h3>
                        </div>
                        <div class="content">
                           <p>If the general values extension is enabled, variables, options,
                              and parameters are not limited to strings. If the select expression
                              that establishes the value of a variable, option, or parameter selects
                              nodes from a tree, then those node values will be passed along as the
                              value.</p>
                           <p>Consider the pipeline in <a href="langext.html#ex-gv-1" title="Pipeline that exploits the general values extension">Example 5.1, “Pipeline that exploits the general values extension”</a>:</p>
                           <figure id="ex-gv-1" class="example-wrapper">
                              <div class="title">Example 5.1. Pipeline that exploits the general values extension</div>
                              <div class="example">
                                 <pre class="programlisting language-xml line-numbers xml"><code>&lt;p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0"&gt;
&lt;p:input port="parameters" kind="parameter"/&gt;
&lt;p:output port="result"/&gt;
&lt;p:serialization port="result" indent="true"/&gt;

&lt;p:identity&gt;
  &lt;p:input port="source"&gt;
    &lt;p:inline&gt;
      &lt;doc&gt;
        &lt;para&gt;Some &lt;emph&gt;text&lt;/emph&gt; in a paragraph.&lt;/para&gt;
      &lt;/doc&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
&lt;/p:identity&gt;

&lt;p:xslt template-name="root"&gt;
  &lt;p:input port="stylesheet"&gt;
    &lt;p:inline&gt;
      &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                      version="2.0"&gt;

        &lt;xsl:param name="text" required="yes"/&gt;
        &lt;xsl:param name="gv" required="yes"/&gt;

        &lt;xsl:template name="root"&gt;
          &lt;root general-values="{$gv}"&gt;
            &lt;xsl:sequence select="$text"/&gt;
          &lt;/root&gt;
        &lt;/xsl:template&gt;
      &lt;/xsl:stylesheet&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
  &lt;p:with-param name="text" select="/doc/para"/&gt;
  &lt;p:with-param name="gv" select="p:system-property('cx:general-values')"
                xmlns:cx="http://xmlcalabash.com/ns/extensions"/&gt;
&lt;/p:xslt&gt;

&lt;/p:declare-step&gt;</code></pre>
                              </div>
                           </figure>
                           <p>In a conformant processor, the <em class="parameter"><code>text</code></em> parameter passed to the
                              <code class="tag-element">p:xslt</code> step is a string:</p>
                           <figure id="ext.general-values.6" class="informalexample-wrapper">
                              <div class="informalexample">
                                 <pre class="programlisting language-xml line-numbers xml"><code>&lt;root general-values="false"&gt;Some text in a paragraph.&lt;/root&gt;</code></pre>
                              </div>
                           </figure>
                           <p>If the general values extension is enabled, the value contains the selected subtree:</p>
                           <figure id="ext.general-values.8" class="informalexample-wrapper">
                              <div class="informalexample">
                                 <pre class="programlisting language-xml line-numbers xml"><code>&lt;root general-values="true"&gt;
   &lt;para&gt;Some &lt;emph&gt;text&lt;/emph&gt; in a paragraph.&lt;/para&gt;
&lt;/root&gt;</code></pre>
                              </div>
                           </figure>
                           <p>The general values extension can be enabled in three ways:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xgeneral-values</code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.general-values</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="general-values" value="true"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                           <p>A pipeline can test whether the general values extension is enabled or not with the
                              <code class="function">p:system-property</code> function using the argument
                              <code class="literal">cx:general-values</code>.</p>
                        </div>
                     </section>
                     <section id="ext.xpointer-on-text" class="section">
                        <div class="section-titlepage">
                           <h3>3.2. XPointer on text</h3>
                        </div>
                        <div class="content">
                           <div class="note admonition">
                              <h3>Note</h3>
                              <div class="admonition-body">
                                 <p>This extension is no longer required.
                                    <a href="https://tools.ietf.org/html/rfc5147">RFC 5147</a> fragment identifiers
                                    are directly supported on the <code class="tag-attribute">fragid</code> property
                                    of XInclude, per the XInclude 1.1 Note.</p>
                              </div>
                           </div>
                           <p>If the XPointer on text extension is enabled, the <code class="tag-attribute">xpointer</code>
                              attribute on an XInclude element can be used when <code class="literal">parse="text"</code>. The XPointer
                              must use the <code class="literal">text()</code> scheme and must contain an
                              <a href="https://tools.ietf.org/html/rfc5147">RFC 5147</a> fragment identifier.
                              Consider
                              the following DocBook XML fragment:</p>
                           <pre class="programlisting language-xml line-numbers xml"><code>&lt;programlisting&gt;
&lt;xi:include href="examples/general-values.xpl" parse="text"
            xpointer="text(line=6,15;length=1081)"/&gt;
&lt;/programlisting&gt;</code></pre>
                           <p>If processed with the XPointer on text extension enabled, it would produce effectively
                              the following
                              result:</p>
                           <pre class="programlisting language-xml line-numbers xml"><code>&lt;programlisting&gt;&lt;![CDATA[
&lt;p:identity&gt;
  &lt;p:input port="source"&gt;
    &lt;p:inline&gt;
      &lt;doc&gt;
        &lt;para&gt;Some &lt;emph&gt;text&lt;/emph&gt; in a paragraph.&lt;/para&gt;
      &lt;/doc&gt;
    &lt;/p:inline&gt;
  &lt;/p:input&gt;
&lt;/p:identity&gt;]]&gt;&lt;/programlisting&gt;</code></pre>
                           <p>Only the “length” integrity check is supported.</p>
                           <p>The XPointer on text extension can be enabled in three ways:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xxpointer-on-text</code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.xpointer-on-text</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="xpointer-on-text" value="true"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                           <p>A pipeline can test whether the XPointer on text extension is enabled or not with
                              the
                              <code class="function">p:system-property</code> function using the argument
                              <code class="literal">cx:xpointer-on-text</code>.</p>
                        </div>
                     </section>
                     <section id="ext.transparent-json" class="section">
                        <div class="section-titlepage">
                           <h3>3.3. Transparent JSON</h3>
                        </div>
                        <div class="content">
                           <p>If the transparent JSON extension is enabled,
                              <code class="tag-element">p:http-request</code>, <code class="tag-element">p:store</code>, <code class="tag-element">p:document</code>,
                              and <code class="tag-element">p:data</code> will translate automatically between JSON and
                              XML. If JSON is returned by a web service or loaded, it will be turned
                              into XML. If a JSON-in-XML document is sent or stored, it will be
                              turned into textual JSON first.</p>
                           <p>Consider this JSON object:</p>
                           <pre class="programlisting language-javascript line-numbers javascript"><code>{
  "id": "1234",
  "": "empty string",
  "foo$bar": "key contains non-name char",
  "1foo$bar": "key starts with non-name-start char",
  "x:html": "key with colon",
  "array": [1,2,3,false,null],
  "bool": false,
  "isnull": null,
  "image": {
    "url": "http://example.com/image.jpg",
    "width": 500,
    "height": 500
  },
  "&lt;crazy&amp;key&gt;": "sane value",
  "\"double quotes\"": "dquoted key",
  "'single quotes'": "squoted key"
}</code></pre>
                           <p>It can be translated into any one of five XML representations:</p>
                           <div class="variablelist">
                              <dl>
                                 <dt><span class="term"><code class="literal">marklogic</code></span></dt>
                                 <dd>
                                    <pre class="programlisting language-xml line-numbers xml"><code>&lt;j:json xmlns:j="http://marklogic.com/json" type="object"&gt;
   &lt;j:_003ccrazy_0026key_003e type="string"&gt;sane value&lt;/j:_003ccrazy_0026key_003e&gt;
   &lt;j:_ type="string"&gt;empty string&lt;/j:_&gt;
   &lt;j:id type="string"&gt;1234&lt;/j:id&gt;
   &lt;j:_0027single_0020quotes_0027 type="string"&gt;squoted key&lt;/j:_0027single_0020quotes_0027&gt;
   &lt;j:_0031foo_0024bar type="string"&gt;key starts with non-name-start char&lt;/j:_0031foo_0024bar&gt;
   &lt;j:x_003ahtml type="string"&gt;key with colon&lt;/j:x_003ahtml&gt;
   &lt;j:isnull type="null"/&gt;
   &lt;j:foo_0024bar type="string"&gt;key contains non-name char&lt;/j:foo_0024bar&gt;
   &lt;j:_0022double_0020quotes_0022 type="string"&gt;dquoted key&lt;/j:_0022double_0020quotes_0022&gt;
   &lt;j:image type="object"&gt;
      &lt;j:height type="number"&gt;500&lt;/j:height&gt;
      &lt;j:width type="number"&gt;500&lt;/j:width&gt;
      &lt;j:url type="string"&gt;http://example.com/image.jpg&lt;/j:url&gt;
   &lt;/j:image&gt;
   &lt;j:bool type="boolean"&gt;false&lt;/j:bool&gt;
   &lt;j:array type="array"&gt;
      &lt;j:item type="number"&gt;1&lt;/j:item&gt;
      &lt;j:item type="number"&gt;2&lt;/j:item&gt;
      &lt;j:item type="number"&gt;3&lt;/j:item&gt;
      &lt;j:item type="boolean"&gt;false&lt;/j:item&gt;
      &lt;j:item type="null"/&gt;
   &lt;/j:array&gt;
&lt;/j:json&gt;</code></pre>
                                 </dd>
                                 <dt><span class="term"><code class="literal"><a href="https://tools.ietf.org/html/draft-rsalz-jsonx-00">jsonx</a></code></span></dt>
                                 <dd>
                                    <pre class="programlisting language-xml line-numbers xml"><code>&lt;j:object xmlns:j="http://www.ibm.com/xmlns/prod/2009/jsonx"&gt;
   &lt;j:string name="&amp;lt;crazy&amp;amp;key&amp;gt;"&gt;sane value&lt;/j:string&gt;
   &lt;j:string name=""&gt;empty string&lt;/j:string&gt;
   &lt;j:string name="id"&gt;1234&lt;/j:string&gt;
   &lt;j:string name="'single quotes'"&gt;squoted key&lt;/j:string&gt;
   &lt;j:string name="1foo$bar"&gt;key starts with non-name-start char&lt;/j:string&gt;
   &lt;j:string name="x:html"&gt;key with colon&lt;/j:string&gt;
   &lt;j:null name="isnull"/&gt;
   &lt;j:string name="foo$bar"&gt;key contains non-name char&lt;/j:string&gt;
   &lt;j:string name="&amp;#34;double quotes&amp;#34;"&gt;dquoted key&lt;/j:string&gt;
   &lt;j:object name="image"&gt;
      &lt;j:number name="height"&gt;500&lt;/j:number&gt;
      &lt;j:number name="width"&gt;500&lt;/j:number&gt;
      &lt;j:string name="url"&gt;http://example.com/image.jpg&lt;/j:string&gt;
   &lt;/j:object&gt;
   &lt;j:boolean name="bool"&gt;false&lt;/j:boolean&gt;
   &lt;j:array name="array"&gt;
      &lt;j:number&gt;1&lt;/j:number&gt;
      &lt;j:number&gt;2&lt;/j:number&gt;
      &lt;j:number&gt;3&lt;/j:number&gt;
      &lt;j:boolean&gt;false&lt;/j:boolean&gt;
      &lt;j:null/&gt;
   &lt;/j:array&gt;
&lt;/j:object&gt;</code></pre>
                                 </dd>
                                 <dt><span class="term"><code class="literal"><a href="http://xml.calldei.com/JsonXML">jxml</a></code></span></dt>
                                 <dd>
                                    <pre class="programlisting language-xml line-numbers xml"><code>&lt;j:object xmlns:j="http://www.xmlsh.org/jxml"&gt;
   &lt;j:member name="&amp;lt;crazy&amp;amp;key&amp;gt;"&gt;
      &lt;j:string&gt;sane value&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name=""&gt;
      &lt;j:string&gt;empty string&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="id"&gt;
      &lt;j:string&gt;1234&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="'single quotes'"&gt;
      &lt;j:string&gt;squoted key&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="1foo$bar"&gt;
      &lt;j:string&gt;key starts with non-name-start char&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="x:html"&gt;
      &lt;j:string&gt;key with colon&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="isnull"&gt;
      &lt;j:null/&gt;
   &lt;/j:member&gt;
   &lt;j:member name="foo$bar"&gt;
      &lt;j:string&gt;key contains non-name char&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="&amp;#34;double quotes&amp;#34;"&gt;
      &lt;j:string&gt;dquoted key&lt;/j:string&gt;
   &lt;/j:member&gt;
   &lt;j:member name="image"&gt;
      &lt;j:object&gt;
         &lt;j:member name="height"&gt;
            &lt;j:number&gt;500&lt;/j:number&gt;
         &lt;/j:member&gt;
         &lt;j:member name="width"&gt;
            &lt;j:number&gt;500&lt;/j:number&gt;
         &lt;/j:member&gt;
         &lt;j:member name="url"&gt;
            &lt;j:string&gt;http://example.com/image.jpg&lt;/j:string&gt;
         &lt;/j:member&gt;
      &lt;/j:object&gt;
   &lt;/j:member&gt;
   &lt;j:member name="bool"&gt;
      &lt;j:boolean&gt;false&lt;/j:boolean&gt;
   &lt;/j:member&gt;
   &lt;j:member name="array"&gt;
      &lt;j:array&gt;
         &lt;j:number&gt;1&lt;/j:number&gt;
         &lt;j:number&gt;2&lt;/j:number&gt;
         &lt;j:number&gt;3&lt;/j:number&gt;
         &lt;j:boolean&gt;false&lt;/j:boolean&gt;
         &lt;j:null/&gt;
      &lt;/j:array&gt;
   &lt;/j:member&gt;
&lt;/j:object&gt;</code></pre>
                                 </dd>
                                 <dt><span class="term"><code class="literal">calabash</code></span></dt>
                                 <dd>
                                    <pre class="programlisting language-xml line-numbers xml"><code>&lt;c:json xmlns:c="http://www.w3.org/ns/xproc-step" type="object"&gt;
   &lt;c:pair name="&amp;lt;crazy&amp;amp;key&amp;gt;" type="string"&gt;sane value&lt;/c:pair&gt;
   &lt;c:pair name="" type="string"&gt;empty string&lt;/c:pair&gt;
   &lt;c:pair name="id" type="string"&gt;1234&lt;/c:pair&gt;
   &lt;c:pair name="'single quotes'" type="string"&gt;squoted key&lt;/c:pair&gt;
   &lt;c:pair name="1foo$bar" type="string"&gt;key starts with non-name-start char&lt;/c:pair&gt;
   &lt;c:pair name="x:html" type="string"&gt;key with colon&lt;/c:pair&gt;
   &lt;c:pair name="isnull" type="null"/&gt;
   &lt;c:pair name="foo$bar" type="string"&gt;key contains non-name char&lt;/c:pair&gt;
   &lt;c:pair name="&amp;#34;double quotes&amp;#34;" type="string"&gt;dquoted key&lt;/c:pair&gt;
   &lt;c:pair name="image" type="object"&gt;
      &lt;c:pair name="height" type="number"&gt;500&lt;/c:pair&gt;
      &lt;c:pair name="width" type="number"&gt;500&lt;/c:pair&gt;
      &lt;c:pair name="url" type="string"&gt;http://example.com/image.jpg&lt;/c:pair&gt;
   &lt;/c:pair&gt;
   &lt;c:pair name="bool" type="boolean"&gt;false&lt;/c:pair&gt;
   &lt;c:pair name="array" type="array"&gt;
      &lt;c:item type="number"&gt;1&lt;/c:item&gt;
      &lt;c:item type="number"&gt;2&lt;/c:item&gt;
      &lt;c:item type="number"&gt;3&lt;/c:item&gt;
      &lt;c:item type="boolean"&gt;false&lt;/c:item&gt;
      &lt;c:item type="null"/&gt;
   &lt;/c:pair&gt;
&lt;/c:json&gt;</code></pre>
                                 </dd>
                                 <dt><span class="term"><code class="literal">calabash-deprecated</code></span></dt>
                                 <dd>
                                    <pre class="programlisting language-xml line-numbers xml"><code>&lt;json type="object"&gt;
   &lt;pair name="&amp;lt;crazy&amp;amp;key&amp;gt;" type="string"&gt;sane value&lt;/pair&gt;
   &lt;pair name="" type="string"&gt;empty string&lt;/pair&gt;
   &lt;pair name="id" type="string"&gt;1234&lt;/pair&gt;
   &lt;pair name="'single quotes'" type="string"&gt;squoted key&lt;/pair&gt;
   &lt;pair name="1foo$bar" type="string"&gt;key starts with non-name-start char&lt;/pair&gt;
   &lt;pair name="x:html" type="string"&gt;key with colon&lt;/pair&gt;
   &lt;pair name="isnull" type="null"/&gt;
   &lt;pair name="foo$bar" type="string"&gt;key contains non-name char&lt;/pair&gt;
   &lt;pair name="&amp;#34;double quotes&amp;#34;" type="string"&gt;dquoted key&lt;/pair&gt;
   &lt;pair name="image" type="object"&gt;
      &lt;pair name="height" type="number"&gt;500&lt;/pair&gt;
      &lt;pair name="width" type="number"&gt;500&lt;/pair&gt;
      &lt;pair name="url" type="string"&gt;http://example.com/image.jpg&lt;/pair&gt;
   &lt;/pair&gt;
   &lt;pair name="bool" type="boolean"&gt;false&lt;/pair&gt;
   &lt;pair name="array" type="array"&gt;
      &lt;item type="number"&gt;1&lt;/item&gt;
      &lt;item type="number"&gt;2&lt;/item&gt;
      &lt;item type="number"&gt;3&lt;/item&gt;
      &lt;item type="boolean"&gt;false&lt;/item&gt;
      &lt;item type="null"/&gt;
   &lt;/pair&gt;
&lt;/json&gt;</code></pre>
                                    <p>This was the original format introduced when JSON support was added to
                                       <code class="tag-element">p:unescape-markup</code>. Don't use it. Automatic conversion from XML to JSON is not
                                       supported for this format.</p>
                                 </dd>
                              </dl>
                           </div>
                           <p>Note that key values in a JSON object are considered unordered. There's
                              no way to preserve the order of keys when switching between representations.</p>
                           <p>The transparent JSON extension can be enabled in three ways:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xtransparent-json</code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.transparent-json</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="transparent-json" value="true"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                           <p>A pipeline can test whether the transparent JSON extension is enabled or not with
                              the
                              <code class="function">p:system-property</code> function using the argument
                              <code class="literal">cx:transparent-json</code>.</p>
                           <p>The desired XML flavor can be selected using the same mechanisms:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xjson-flavor=<em class="replaceable"><code>flavor</code></em></code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.json-flavor</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="json-flavor" value="<em class="replaceable"><code>flavor</code></em>"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                           <p>The flavors are “<code class="literal">marklogic</code>”, “<code class="literal">jsonx</code>”,
                              “<code class="literal">jxml</code>”, “<code class="literal">calabash</code>”, and
                              “<code class="literal">calabash-deprecated</code>”.</p>
                           <p>A pipeline can determine the current flavor with the
                              <code class="function">p:system-property</code> function using the argument
                              <code class="literal">cx:json-flavor</code>.</p>
                        </div>
                     </section>
                     <section id="ext.use-xslt-10" class="section">
                        <div class="section-titlepage">
                           <h3>3.4. Use XSLT 1.0</h3>
                        </div>
                        <div class="content">
                           <p>The “use XSLT 1.0” extension enables processing of XSLT 1.0 stylesheets
                              with an XSLT 1.0 processor. See <a href="p-xslt.html#p-xslt-ext" title="Extensions">the section called “Extensions”</a> in
                              <a href="p-xslt.html"><span class="refname">p:xslt</span></a>.</p>
                           <p>The XSLT 1.0 extension can be enabled in three ways:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xuse-xslt-10</code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.use-xslt-10</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="use-xslt-10" value="true"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                        </div>
                     </section>
                     <section id="ext.html-serializer" class="section">
                        <div class="section-titlepage">
                           <h3>3.5. HTML serializer</h3>
                        </div>
                        <div class="content">
                           <p>If the “HTML serializer” extension is used, then all documents
                              that are serialized with the “html” method will be serialized with the
                              <a href="http://about.validator.nu/">Validator.nu</a>
                              HTML serializer.</p>
                           <p>The HTML serializer extension can be enabled in three ways:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>With the <code class="literal">-Xhtml-serializer</code> command-line option.</p>
                                 </li>
                                 <li>
                                    <p>With the <code class="literal">com.xmlcalabash.html-serializer</code> Java system property.</p>
                                 </li>
                                 <li>
                                    <p>Or with the <code class="literal">&lt;extension name="html-serializer" value="true"/&gt;</code>
                                       configuration option.</p>
                                 </li>
                              </ol>
                           </div>
                           <p>A few points:</p>
                           <div class="orderedlist">
                              <ol style="list-style: decimal;">
                                 <li>
                                    <p>This option serializes all HTML documents with the HTML serializer;
                                       it pays no attention to the version.</p>
                                 </li>
                                 <li>
                                    <p>If the Saxon configured serializer doesn't have any output destination
                                       (or if it has an unrecognized output destination), then this option has
                                       no effect. (I'm not sure it's possible to configure the Saxon serializer
                                       this way, but maybe if you're playing in the APIs…)</p>
                                 </li>
                                 <li>
                                    <p>None of the other output options (indent, doctype, etc.) have any
                                       effect when the HTML serializer is used.</p>
                                 </li>
                              </ol>
                           </div>
                        </div>
                     </section>
                     <section id="ext.allow-text-results" class="section">
                        <div class="section-titlepage">
                           <h3>3.6. Allow text results extension</h3>
                        </div>
                        <div class="content">
                           <p>If the allow text results extension is enabled,
                              <code class="tag-element">p:xquery</code> and
                              <code class="tag-element">p:xslt</code>
                              steps may return atomic values and text documents (documents that
                              aren't XML). These documents will be encoded in XML as
                              <code class="tag-element">c:result</code> documents with a
                              <code class="tag-attribute">content-type</code> attribute that identifies
                              them as being of type
                              “<code class="literal">text/plain</code>” and a
                              <code class="tag-attribute">cx:decode</code> attribute with the value
                              “<code class="literal">true</code>”. The <code class="tag-element">p:store</code> step will serialize
                              them as text.</p>
                        </div>
                     </section>
                  </div>
               </section>
            </div>
         </div>
         <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="navfooter">
            <table width="100%" summary="Navigation table">
               <tr>
                  <td width="40%" align="left"><a title="2 .  Extension Attributes" href="extattr.html"><img src="img/prev.png" alt="Prev" border="0" /></a> </td>
                  <td width="20%" align="center"><a title="XML Calabash Reference" href="index.html"><img src="img/home.png" alt="Home" border="0" /></a></td>
                  <td width="40%" align="right"> <a title="4 .  Extension functions" href="extfunc.html"><img src="img/next.png" alt="Next" border="0" /></a></td>
               </tr>
               <tr>
                  <td width="40%" align="left">2 .  Extension Attributes </td>
                  <td width="20%" align="center"><a title="Chapter  5 .  Extensions" href="extensions.html"><img src="img/up.png" alt="Up" border="0" /></a></td>
                  <td width="40%" align="right"> 4 .  Extension functions</td>
               </tr>
            </table>
         </div>
         <div xmlns:tmpl="http://docbook.org/xslt/titlepage-templates" class="copyrightfooter">
            <p><a href="dbcpyright.html">Copyright</a> © 2011–2020 Norman Walsh.</p>
         </div>
      </div>
   </body>
</html>